package com.mayikt.service.days;

/**
 * @ClassName Test002
 * @Author 蚂蚁课堂余胜军 QQ644064779 www.mayikt.com
 * @Version V1.0
 **/
public class Test002 {
    public static void main(String[] args) {
        String abA = "ab";
        String ab1 = new String("a") + new String("b");
        String ab2 = ab1.intern();// 将我们对象放入到字符串常量池中 如果常量池中存在 则不会放入
        System.out.println(ab2 == abA);
//        String ab2 = "ab";
//        System.out.println(ab1 == ab2);
//        String a1 = "a";
//        String a2 = "a";
//        System.out.println(a1 == a2);
    }
}
